var express = require('express');
var router = express.Router();
var userController = require("../controller/userController")
/* GET users listing. */
router.get('/', function (req, res, next) {
  res.send('respond with a resource');
});
//注册接口
router.post('/regist', userController.register)

//登录接口
router.post('/login', userController.login)

//验证码接口
router.post('/sendCode', userController.sendCode)
//模拟验证登录
router.post('/codePhoneLogin', userController.codePhoneLogin)
//短信验证登录
router.post('/sendCoreCode', userController.sendCoreCode)

router.get('/logout', (req, res) => {
  req.session.username = null
  res.redirect('/login')
})

module.exports = router;